﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI;
using SPAdvancedSearch.Editors;

namespace SPAdvancedSearch.Inputs
{
    /// <summary>
    /// Defines a base class for advanced search property values.
    /// </summary>
    public abstract class ValueControlBase : WebControl
    {
        #region Fields

        private string _managedPropertyName;

        #endregion

        #region Properties

        /// <summary>
        /// Gets the managed property name for this value control.
        /// </summary>
        protected string ManagedPropertyName
        {
            get { return _managedPropertyName; }
        }

        #endregion

        #region Ctor

        /// <summary>
        /// Creates an instance of <see cref="EditorControlBase"/>.
        /// </summary>
        /// <param name="managedPropertyName"></param>
        protected ValueControlBase(string managedPropertyName)
        {
            _managedPropertyName = managedPropertyName;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Allows derived classes to define the appropriate advanced search UI display control.
        /// </summary>
        /// <returns></returns>
        public abstract ISearchPropertyInputControl GetDisplayControl();

        /// <summary>
        /// Allows derived classes to define the appropriate Toolpane editor control.
        /// </summary>
        /// <returns></returns>
        public abstract EditorControlBase GetEditorControl();

        #endregion

    }
}
